package com.tang.common.redis;

/**
 * 鉴权模块的Redis键构造器
 *
 * @author Tang
 * @date 2024/2/13 16:34
 **/
public class AuthKeyBuilder {
    private static String authPermissionPrefix = "auth.permission";
    private static String authRolePrefix = "auth.role";
    private static final String CACHE_KEY_SEPARATOR = ".";

    public static String getPermissionKey(String... args) {
        return authPermissionPrefix + "." + String.join(CACHE_KEY_SEPARATOR, args);
    }

    public static String getRoleKey(String... args) {
        return authRolePrefix + "." + String.join(CACHE_KEY_SEPARATOR, args);
    }

    private AuthKeyBuilder() {
    }
}
